class User < ActiveRecord::Base
  attr_accessible :birthday, :curaddress, :fathername, :homeaddress, :name, :sex, :surname, :email, :password, :typee, :status,:group,:photo

  
  
  validates_confirmation_of :password

  validates_presence_of :email
  validates_uniqueness_of :email
  
  has_many :contacts
  has_many :groups

  def self.authenticate(email, password)
    where(:email => email, :password => password).first
  end
end
